package com.nana.framework.dll
{
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	import flash.system.ApplicationDomain;
	
	public class Dll extends EventDispatcher
	{
		private static var instance:Dll;
		
		public var mainAppDomain:ApplicationDomain;
		public var floder:String;
		public var outFloder:String;
		public var lang:String = "cn";
		public var status:String = "";
		public var fileList:FileList;
		private var loadingLoader:DllLoader;
		private var mainLoader:DllLoader;
		private var listTimer:Timer;
		private var delayLoader:DllLoader;
		private var delayFuncDic:Dictionary;
		private var currentDllLoader:DllLoader;
		private var dllFileLoader:DllLoader;
		private var lisLoader:DllLoader;
		private var dddAnalyze:DDDAnalyze;
		private var libAnalyze:LibAnalyze;
		private var darAnalyze:DarAnalyze;
		private var dllRequestDic:Array;
		private var appDomain:ApplicationDomain;
		private var _imgAnalyze:ImgAnalyze;
		private var _imgDic:Dictionary;
		private var _binLoadList:Array;
		private var _darLoadList:Array;
		private var _urlStream:URLStream;
		private var _loadingUrl:String;
		private var _loaderDic:Dictionary;
		private var _requestStreamList:Array;
		private var _streamByte:ByteArray;
		private var _tempDisplayObjectContainer:DisplayObjectContainer;
		
		public function Dll(){
			this.listTimer = new Timer(10);
			this.delayFuncDic = new Dictionary();
			this.dddAnalyze = (AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_DDD) as DDDAnalyze);
			this.libAnalyze = (AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_LIB) as LibAnalyze);
			this.darAnalyze = (AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_DAR) as DarAnalyze);
			this.dllRequestDic = [];
			this._imgAnalyze = (AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_IMG) as ImgAnalyze);
			this._imgDic = new Dictionary();
			this._binLoadList = [];
			this._darLoadList = [];
			super();
			if (instance == null){
				instance = this;
			} else {
				throw new Error("实例化单例类出错-Dll");
			}
		}
		
		public static function getInstance():Dll{
			if (instance == null){
				instance = new Dll();
			}
			return instance;
		}
		
		public static function getConfingXmlList():Object{
			return (IniToFlieList.CONFIG_XML_LIST);
		}
		
		public function loadINIXML(_arg1:Array, _arg2:String="", _arg3:String=""):void{
			var _local4:IniToFlieList = new IniToFlieList();
			_local4.analyzeXml(_arg1, this.lang, this.status, this.loadINIXMLComp, _arg2, _arg3);
		}
		
		private function loadINIXMLComp(_arg1:FileList):void{
			this.fileList = _arg1;
			this.startLoad();
		}
		
		private function startLoad():void{
			this.loadLoadingList();
		}
		public function loadLoadingList():void{
			this.loadingLoader = new DllLoader();
			this.currentDllLoader = this.loadingLoader;
			this.loadingLoader.load(this.fileList.loadingList);
			this.loadingLoader.addEventListener(MultiLoaderEvent.COMPLETE, this.loadingComplete);
			this.loadingLoader.addEventListener(MultiLoaderEvent.PROGRESS, this.loadingProgress);
		}
		private function loadingProgress(_arg1:MultiLoaderEvent):void{
			var _local2:DllEvent = new DllEvent(DllEvent.PROGRESS, _arg1.data);
			dispatchEvent(_local2);
		}
		private function loadingComplete(_arg1:MultiLoaderEvent):void{
			var _local2:Dll = Dll.getInstance();
			Dll.getInstance().dispatchEvent(new DllEvent(DllEvent.LOADING_COMPLETE));
			this.loadMainList();
			this.loadingLoader.removeEventListener(MultiLoaderEvent.COMPLETE, this.loadingComplete);
			this.loadingLoader.removeEventListener(MultiLoaderEvent.PROGRESS, this.loadingProgress);
			this.loadingLoader = null;
		}
		public function loadMainList():void{
			this.mainLoader = new DllLoader();
			this.currentDllLoader = this.mainLoader;
			this.mainLoader.load(this.fileList.mainList);
			this.mainLoader.addEventListener(MultiLoaderEvent.COMPLETE, this.mainComplete);
			this.mainLoader.addEventListener(MultiLoaderEvent.PROGRESS, this.mainProgress);
		}
		private function mainProgress(_arg1:MultiLoaderEvent):void{
			var _local2:DllEvent = new DllEvent(DllEvent.PROGRESS, _arg1.data);
			dispatchEvent(_local2);
		}
		private function mainComplete(_arg1:MultiLoaderEvent):void{
			Dll.getInstance().dispatchEvent(new DllEvent(DllEvent.COMPLETE));
			this.loadDelayedList();
			this.mainLoader.removeEventListener(MultiLoaderEvent.COMPLETE, this.mainComplete);
			this.mainLoader = null;
			this.listTimer.addEventListener(TimerEvent.TIMER, this.onEnterFrameHandler);
			this.listTimer.start();
		}
		public function loadDelayedList():void{
			if (!this.fileList.delayedList.length){
				return;
			};
			this.delayLoader = new DllLoader();
			this.currentDllLoader = this.delayLoader;
			this.delayLoader.load(this.fileList.delayedList);
			this.delayLoader.addEventListener(MultiLoaderEvent.COMPLETE, this.delayLoaderComplete);
		}
		private function delayLoaderComplete(_arg1:MultiLoaderEvent):void{
			var _local2:String;
			var _local3:DisplayObject;
			var _local4:LibAnalyze;
			var _local5:Function;
			for (_local2 in this.delayFuncDic) {
				_local4 = (AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_LIB) as LibAnalyze);
				_local3 = (_local4.getDisplayObjectByName(_local2) as DisplayObject);
				if (_local3){
					_local5 = this.delayFuncDic[_local2];
					_local5(_local3);
					delete this.delayFuncDic[_local2];
				};
			};
		}
		public function getDelayMaterialByClassName(_arg1:String, _arg2:Function):void{
			var _local3:DisplayObject;
			this.delayFuncDic[_arg1] = _arg2;
			var _local4:LibAnalyze = (AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_LIB) as LibAnalyze);
			_local3 = (_local4.getDisplayObjectByName(_arg1) as DisplayObject);
			if (_local3){
				_arg2(_local3);
				delete this.delayFuncDic[_arg1];
			};
		}
		public function loadGroupList(_arg1:String):void{
		}
		public function addLoaderList(_arg1:Array):void{
			var _local4:DllFileObject;
			var _local2:Array = [];
			var _local3:int;
			while (_local3 < _arg1.length) {
				_local4 = new DllFileObject(_arg1[_local3].url, _arg1[_local3].name, 0, "", _arg1[_local3].type);
				_local2.push(_local4);
				_local3++;
			};
			this.currentDllLoader.addLoaderList(_local2);
		}
		public function loadDllFileObject(_arg1:Array):void{
			this.dllFileLoader = new DllLoader();
			this.dllFileLoader.load(_arg1);
		}
		public function loadLisFiles(_arg1:Array):void{
			var _local4:DllFileObject;
			this.lisLoader = new DllLoader();
			var _local2:Array = [];
			var _local3:int;
			while (_local3 < _arg1.length) {
				_local4 = new DllFileObject();
				_local4.url = _arg1[_local3].url;
				_local4.name = _arg1[_local3].name;
				_local2.push(_local4);
				_local3++;
			};
			this.lisLoader.load(_local2);
		}
		public function loadFilesByServerId(_arg1:Array, _arg2:Function=null):void{
			var _local9:Array;
			var _local10:DllFileObject;
			var _local11:DllLoader;
			var _local3:DDDAnalyze = (AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_DDD) as DDDAnalyze);
			var _local4:Array = [];
			var _local5:Array = [];
			var _local6:int;
			while (_local6 < _arg1.length) {
				_local4 = _local4.concat(_local3.getDataByServerId(_arg1[_local6]));
				_local6++;
			};
			var _local7:LisAnalyze = (AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_LIS) as LisAnalyze);
			var _local8:int;
			while (_local8 < _local4.length) {
				_local9 = _local7.getLisDataByMid(_local4[_local8].mid);
				if (_local9){
				} else {
					_local10 = new DllFileObject((IniToFlieList.outFloder + _local4[_local8].swfurl), _local4[_local8].typeName, 0, "", DllFileObject.TYPE_LIS);
					_local5.push(_local10);
				};
				_local8++;
			};
			if (_local5.length){
				_local11 = new DllLoader();
				_local11.load(_local5);
				if (_arg2 != null){
					_local11.addEventListener(MultiLoaderEvent.PROGRESS, _arg2);
				};
			};
		}
		public function getMaterialClassByServerId(_arg1:int, _arg2:String, _arg3:Function, _arg4:Boolean=false, _arg5:Boolean=false, _arg6:String=""):void{
			var _local7:Object = new Object();
			_local7["serverId"] = _arg1;
			_local7["materialClassName"] = _arg2;
			_local7["completeFunc"] = _arg3;
			_local7["typeFlag"] = _arg4;
			_local7["loadFlag"] = _arg5;
			_local7["subClass"] = _arg6;
			this.dllRequestDic.push(_local7);
		}
		private function onEnterFrameHandler(_arg1:TimerEvent):void{
			var _local2:Array;
			var _local3:Array;
			var _local4:Array;
			if ((((((this.dllRequestDic.length == 0)) && ((this._binLoadList.length == 0)))) && ((this._darLoadList.length == 0)))){
				return;
			};
			if (this.dllRequestDic.length != 0){
				_local2 = this.dllRequestDic.concat();
				this.dllRequestDic.length = 0;
				this.dealLoadList(_local2);
			};
			if (this._binLoadList.length != 0){
				_local3 = this._binLoadList.concat();
				this._binLoadList.length = 0;
				this.dealLoadList(_local3, 1);
			};
			if (this._darLoadList.length != 0){
				_local4 = this._darLoadList.concat();
				this._darLoadList.length = 0;
				this.dealLoadList(_local4, 2);
			};
		}
		private function dealLoadList(_arg1:Array, _arg2:int=0):void{
			var _local3:int;
			var _local4:int = _arg1.length;
			switch (_arg2){
				case 0:
					_local3 = 0;
					while (_local3 < _local4) {
						this.startLoadList(_arg1[_local3]);
						_local3++;
					};
					break;
				case 1:
					_local3 = 0;
					while (_local3 < _local4) {
						this.startLoadBinList(_arg1[_local3]);
						_local3++;
					};
					break;
				case 2:
					_local3 = 0;
					while (_local3 < _local4) {
						this.startLoadDarList(_arg1[_local3]);
						_local3++;
					};
					break;
			};
		}
		private function startLoadDarList(_arg1:Object):void{
			var _local9:Object;
			var _local13:DllLoader;
			var _local2:int = _arg1["serverId"];
			var _local3:String = _arg1["materialClassName"];
			var _local4:Function = _arg1["completeFunc"];
			var _local5:int = _arg1["weight"];
			var _local6:String = _arg1["subClass"];
			var _local7:DarAnalyze = (AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_DAR) as DarAnalyze);
			var _local8:DarBitmapData = _local7.getDarwinBitmapDataByName(_local3);
			if (_local8){
				_local4(_local8);
				return;
			};
			if (_local6 == ""){
				_local9 = this.dddAnalyze.getMaterialDataByServerId(String(_local2));
			} else {
				_local9 = this.dddAnalyze.getMaterialDataByServerIdAndSunClass(String(_local2), _local6);
			};
			var _local10:DllFileObject = new DllFileObject((this.outFloder + _local9["swfurl"]), _local9["swfurl"], 0, "", DllFileObject.TYPE_DAR);
			_local10.subClass = _local6;
			_local10.serverid = _local2.toString();
			var _local11:String = (("" + _local2) + _local6);
			_local10.name = _local11;
			_local10.materialClassName = _local3;
			_local7.registerDarFuncDic(String(_local2), _local4, _local6);
			var _local12:DllFileObject = _local7.listDllFileObject[_local11];
			if (!_local12){
				_local7.listDllFileObject[_local11] = _local10;
				_local10.status = DllFileObject.LOADING;
				_local13 = new DllLoader();
				_local13.load([_local10]);
				_local13.addEventListener(MultiLoaderEvent.COMPLETE, this.onDarLoaderComplete);
			};
		}
		private function onDarLoaderComplete(_arg1:MultiLoaderEvent):void{
			var _local3:DarAnalyze;
			var _local4:Array;
			var _local5:DarBitmapData;
			var _local6:int;
			var _local7:Function;
			var _local2:DllFileObject = (_arg1.data[0] as DllFileObject);
			if (_local2){
				_local3 = (AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_DAR) as DarAnalyze);
				_local4 = _local3.darwinFuncDic[_local2.name];
				_local5 = _local3.getDarwinBitmapDataByName(_local2.materialClassName);
				if (_local4.length){
					_local6 = 0;
					while (_local6 < _local4.length) {
						_local7 = _local4[_local6]["completeFunc"];
						_local7(_local5);
						_local6++;
					};
					_local4.length = 0;
				};
			};
		}
		private function startLoadBinList(_arg1:Object):void{
			var _local8:Object;
			var _local12:DllLoader;
			var _local2:int = _arg1["serverId"];
			var _local3:String = _arg1["subClass"];
			var _local4:Function = _arg1["completeFunc"];
			var _local5:String = (("" + _local2) + _local3);
			var _local6:BinAnalyze = (AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_BIN) as BinAnalyze);
			var _local7:ByteArray = _local6.getBinDataByName(_local5);
			if (_local7){
				_local4(_local7);
				return;
			};
			if (_local3 == ""){
				_local8 = this.dddAnalyze.getMaterialDataByServerId(String(_local2));
			} else {
				_local8 = this.dddAnalyze.getMaterialDataByServerIdAndSunClass(String(_local2), _local3);
			};
			var _local9:DllFileObject = new DllFileObject((this.outFloder + _local8["swfurl"]), _local8["swfurl"], 0, "", DllFileObject.TYPE_BIN);
			_local9.subClass = _local3;
			_local9.serverid = _local2.toString();
			var _local10:String = (("" + _local2) + _local3);
			_local9.name = _local10;
			_local6.registerBinFuncDic(String(_local2), _local4, _local3);
			var _local11:DllFileObject = _local6.listDllFileObject[_local10];
			if (!_local11){
				_local6.listDllFileObject[_local10] = _local9;
				_local9.status = DllFileObject.LOADING;
				_local12 = new DllLoader();
				_local12.load([_local9]);
				_local12.addEventListener(MultiLoaderEvent.COMPLETE, this.onBinLoaderComplete);
			};
		}
		private function onBinLoaderComplete(_arg1:MultiLoaderEvent):void{
			var _local3:BinAnalyze;
			var _local4:Array;
			var _local5:ByteArray;
			var _local6:int;
			var _local7:Function;
			var _local8:ByteArray;
			var _local2:DllFileObject = (_arg1.data[0] as DllFileObject);
			if (_local2){
				_local3 = (AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_BIN) as BinAnalyze);
				_local4 = _local3.binFuncDic[_local2.name];
				_local5 = _local3.getBinDataByName(_local2.name);
				if (_local4.length){
					_local6 = 0;
					while (_local6 < _local4.length) {
						_local7 = _local4[_local6]["completeFunc"];
						_local8 = new ByteArray();
						_local5.readBytes(_local8, 0, _local5.bytesAvailable);
						_local7(_local8);
						_local5.position = 0;
						_local6++;
					};
					_local4.length = 0;
				};
			};
		}
		private function startLoadList(_arg1:Object):void{
			var _local9:Object;
			var _local12:Boolean;
			var _local13:int;
			var _local16:int;
			var _local18:DisplayObject;
			var _local19:DllFileObject;
			var _local20:DllFileObject;
			var _local21:DllLoader;
			var _local2:int = _arg1["serverId"];
			var _local3:String = _arg1["materialClassName"];
			var _local4:Function = _arg1["completeFunc"];
			var _local5:Boolean = _arg1["typeFlag"];
			var _local6:Boolean = _arg1["loadFlag"];
			var _local7:String = _arg1["subClass"];
			var _local8:Class = this.libAnalyze.getClassByName(_local3);
			if (_local8){
				if (_local5){
					_local4(_local8);
				} else {
					_local18 = new (_local8)();
					_local18["materialClassName"] = _local3;
					_local4(_local18);
				};
				return;
			};
			if (_local7 == ""){
				_local9 = this.dddAnalyze.getMaterialDataByServerId(String(_local2));
			} else {
				_local9 = this.dddAnalyze.getMaterialDataByServerIdAndSunClass(String(_local2), _local7);
			};
			var _local10:DllFileObject = new DllFileObject((this.outFloder + _local9["swfurl"]), _local9["swfurl"], 0, "", DllFileObject.TYPE_LIB);
			_local10.subClass = _local7;
			_local10.serverid = _local2.toString();
			LisDictionary.getInstance().registerMaterialClassDic(_local2.toString(), _local3, _local4, _local5, _local7);
			var _local11:Array = LisDictionary.getInstance().lisDllFileObjct;
			if (_local11.length == 0){
				_local11.push(_local10);
			};
			var _local14:int = _local11.length;
			_local13 = 0;
			while (_local13 < _local14) {
				_local19 = _local11[_local13];
				if (_local19.serverid == _local10.serverid){
					if (_local7 == ""){
						_local12 = true;
					};
					break;
				};
				_local13++;
			};
			if (!_local12){
				_local11.push(_local10);
			};
			var _local15:Array = LisDictionary.getInstance().lisDllFileObjct;
			var _local17:int = _local15.length;
			_local16 = 0;
			while (_local16 < _local17) {
				_local20 = _local15[_local16];
				if (int(_local20.serverid) == _local2){
					if ((((_local20.subClass == _local7)) && ((_local20.status == DllFileObject.NOT_LOADED)))){
						_local20.status = DllFileObject.LOADING;
						_local21 = new DllLoader();
						_local21.load([_local20]);
						_local21.addEventListener(MultiLoaderEvent.COMPLETE, this.onComplete);
						break;
					};
				};
				_local16++;
			};
		}
		public function openLoad():void{
			var _local3:DllFileObject;
			var _local4:DllLoader;
			var _local1:Array = LisDictionary.getInstance().lisDllFileObjct;
			var _local2:int;
			while (_local2 < _local1.length) {
				_local3 = _local1[_local2];
				if (_local3.status == DllFileObject.NOT_LOADED){
					_local3.status = DllFileObject.LOADING;
					_local4 = new DllLoader();
					_local4.load([_local3]);
					_local4.addEventListener(MultiLoaderEvent.COMPLETE, this.onComplete);
					break;
				};
				_local2++;
			};
		}
		private function onComplete(_arg1:MultiLoaderEvent):void{
			var _local2:Class;
			var _local8:String;
			var _local9:Function;
			var _local10:Boolean;
			var _local11:DisplayObject;
			var _local12:Function;
			_arg1.target.removeEventListener(MultiLoaderEvent.COMPLETE, this.onComplete);
			this.appDomain = (_arg1.data[0].result["appDomain"] as ApplicationDomain);
			var _local3:* = _arg1.data[0].serverid;
			var _local4:String = _arg1.data[0].subClass;
			var _local5:Array = LisDictionary.getInstance().classListDic[(_local3 + _local4)];
			if (_local5 == null){
				return;
			};
			var _local6:int;
			while (_local6 < _local5.length) {
				_local8 = _local5[_local6]["className"];
				if (this.appDomain.hasDefinition(_local8)){
					_local2 = (this.appDomain.getDefinition(_local8) as Class);
				};
				if (!_local2){
				} else {
					_local9 = _local5[_local6]["completeFunc"];
					_local10 = _local5[_local6]["typeFlag"];
					if (_local10){
						if (_local9 != null){
							_local9(_local2);
						};
					} else {
						if (_local9 != null){
							_local11 = new (_local2)();
							_local11["materialClassName"] = _local8;
							_local9(_local11);
						};
					};
					_local5[_local6]["completeFunc"] = null;
				};
				_local6++;
			};
			var _local7:int;
			while (_local7 < _local5.length) {
				_local12 = _local5[_local7]["completeFunc"];
				if (_local12 == null){
					_local5.splice(_local7, 1);
					break;
				};
				_local7++;
			};
		}
		public function getImgMaterialByUrl(_arg1:String, _arg2:Function):void{
			var _local3:Object = new Object();
			var _local4:Bitmap = this._imgAnalyze.getBitmapByUrl(_arg1);
			_local3["bitmap"] = _local4;
			_local3["url"] = _arg1;
			if (_local4){
				_arg2(_local3);
				return;
			};
			var _local5:DllFileObject = new DllFileObject((this.outFloder + _arg1), _arg1, 0, "", DllFileObject.TYPE_IMG);
			this._imgDic[_arg1] = _arg2;
			var _local6:DllLoader = new DllLoader();
			_local6.load([_local5]);
			_local6.addEventListener(MultiLoaderEvent.COMPLETE, this.imgOnComplete);
		}
		private function imgOnComplete(_arg1:MultiLoaderEvent):void{
			var _local2:DllFileObject = _arg1.data[0];
			var _local3:Function = this._imgDic[_local2.name];
			var _local4:Bitmap = Bitmap(_local2.result);
			var _local5:Object = new Object();
			_local5["bitmap"] = _local4;
			_local5["url"] = _local2.name;
			if (_local3 != null){
				_local3(_local5);
				delete this._imgDic[_local2.name];
			};
		}
		public function cancleGetMaterial(_arg1:int, _arg2:Function):void{
			var _local5:Function;
			var _local3:Array = LisDictionary.getInstance().classListDic[String(_arg1)];
			if (!_local3){
				return;
			};
			var _local4:int;
			while (_local4 < _local3.length) {
				_local5 = _local3[_local4]["completeFunc"];
				if (_local5 == _arg2){
					_local3[_local4]["completeFunc"] = null;
					break;
				};
				_local4++;
			};
		}
		public function getDataByServerId(_arg1:String, _arg2:Function):void{
			var completeArray:* = null;
			var loadArray:* = null;
			var lisComplete:* = null;
			var lisLoaded:* = null;
			var lisData:* = null;
			var dllFileObject:* = null;
			var lis:* = 0;
			var tempDllFileObject:* = null;
			var dicFuncArray:* = null;
			var dic:* = 0;
			var dllLoader:* = null;
			var serverId:* = _arg1;
			var completeFunc:* = _arg2;
			lisComplete = function (_arg1:MultiLoaderEvent):void{
				var _local2:int;
				var _local4:int;
				while (_local2 < _arg1.data.length) {
					completeArray = completeArray.concat(_arg1.data[_local2].result);
					_local2++;
				};
				if (completeArray.length != loadArray.length){
					return;
				};
				var _local3:Array = LisDictionary.getInstance().listDic[serverId];
				if (_local3){
					_local4 = 0;
					while (_local4 < _local3.length) {
						var _local5 = _local3;
						_local5[_local4](completeArray);
						_local4++;
					};
					delete LisDictionary.getInstance().listDic[serverId];
				};
			};
			lisLoaded = function (_arg1:Event):void{
				var _local3:int;
				if (completeArray.length != loadArray.length){
					return;
				};
				completeArray = completeArray.concat((_arg1.target as DllFileObject).result);
				var _local2:Array = LisDictionary.getInstance().listDic[serverId];
				if (_local2){
					_local3 = 0;
					while (_local3 < _local2.length) {
						var _local4 = _local2;
						_local4[_local3](completeArray);
						_local3++;
					};
					delete LisDictionary.getInstance().listDic[serverId];
				};
			};
			LisDictionary.getInstance().registerDic(serverId, completeFunc);
			completeArray = [];
			var delayLoadArray:* = [];
			var dddAnalyze:* = (AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_DDD) as DDDAnalyze);
			loadArray = dddAnalyze.getDataByServerId(serverId);
			var lisAnalyze:* = (AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_LIS) as LisAnalyze);
			var i:* = 0;
			while (i < loadArray.length) {
				lisData = lisAnalyze.getLisDataByMid(loadArray[i].mid);
				if (lisData){
					completeArray = completeArray.concat(lisData);
				} else {
					dllFileObject = new DllFileObject((IniToFlieList.outFloder + loadArray[i].swfurl), loadArray[i].typeName, 0, "", DllFileObject.TYPE_LIS);
					if (LisDictionary.getInstance().lisDllFileObjct.length != 0){
						lis = 0;
						while (lis < LisDictionary.getInstance().lisDllFileObjct.length) {
							tempDllFileObject = LisDictionary.getInstance().lisDllFileObjct[lis];
							if (((((tempDllFileObject) && ((tempDllFileObject.url == dllFileObject.url)))) && ((tempDllFileObject.status == DllFileObject.LOADING)))){
								tempDllFileObject.addEventListener(DllEvent.SWFURL_COMPLETE, lisLoaded);
							} else {
								delayLoadArray.push(dllFileObject);
								LisDictionary.getInstance().lisDllFileObjct.push(dllFileObject);
							};
							lis = (lis + 1);
						};
					} else {
						delayLoadArray.push(dllFileObject);
						LisDictionary.getInstance().lisDllFileObjct.push(dllFileObject);
					};
				};
				i = (i + 1);
			};
			if (completeArray.length == loadArray.length){
				dicFuncArray = LisDictionary.getInstance().listDic[serverId];
				dic = 0;
				while (dic < dicFuncArray.length) {
					var _local4 = dicFuncArray;
					_local4[dic](completeArray);
					dic = (dic + 1);
				};
				delete LisDictionary.getInstance().listDic[serverId];
				return;
			};
			if (delayLoadArray.length){
				dllLoader = new DllLoader();
				dllLoader.load(delayLoadArray);
				dllLoader.addEventListener(MultiLoaderEvent.COMPLETE, lisComplete);
			};
		}
		public function getlisClassByName(_arg1:Array, _arg2:String):Class{
			var _local3:Class;
			var _local5:ApplicationDomain;
			var _local4:int;
			while (_local4 < _arg1.length) {
				_local5 = _arg1[_local4].appDomain;
				if (_local5.hasDefinition(_arg2)){
					_local3 = (_local5.getDefinition(_arg2) as Class);
					return (_local3);
				};
				_local4++;
			};
			return (null);
		}
		public function disposeGetDataByServerId(_arg1:String, _arg2:Function):void{
			var _local4:int;
			var _local3:Array = LisDictionary.getInstance().listDic[_arg1];
			if (_local3){
				_local4 = _local3.indexOf(_arg2);
				if (_local4 != -1){
					_local3.splice(_local4, 1);
				};
			};
		}
		public function getJsonDataByName(_arg1:String):Object{
			var _local2:Object = (AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_JSON) as JsonAnalyze).getJsonObjectByName(_arg1);
			return (_local2);
		}
		public function getXMLDataByName(_arg1:String):XML{
			var _local2:XML = (AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_XML) as XMLAnalyze).getXMLByName(_arg1);
			return (_local2);
		}
		public function getDDDByName(_arg1:String):Object{
			var _local2:Object = (AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_DDD) as DDDAnalyze).getDDDDataByName(_arg1);
			return (_local2);
		}
		public function getBinObjectByName(_arg1:String):ByteArray{
			var _local2:ByteArray = ((AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_LIB) as LibAnalyze).getByteArrayByName(_arg1) as ByteArray);
			if (!_local2){
				_local2 = (AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_BIN) as BinAnalyze).getBinDataByName(_arg1);
			};
			return (_local2);
		}
		public function getBinDataByServerId(_arg1:int, _arg2:Function, _arg3:int=0, _arg4:String=""):void{
			var _local5:Object = {};
			_local5["serverId"] = _arg1;
			_local5["subClass"] = _arg4;
			_local5["completeFunc"] = _arg2;
			_local5["weight"] = _arg3;
			this._binLoadList.push(_local5);
		}
		public function getDarDataByServerIdMaterialClassName(_arg1:int, _arg2:String, _arg3:Function, _arg4:int=0):void{
			var _local5:Object = new Object();
			_local5["serverId"] = _arg1;
			_local5["materialClassName"] = _arg2;
			_local5["completeFunc"] = _arg3;
			_local5["weight"] = _arg4;
			_local5["subClass"] = _arg2;
			this._darLoadList.push(_local5);
		}
		public function getByteArrayByName(_arg1:String):ByteArray{
			var _local2:ByteArray = ((AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_LIB) as LibAnalyze).getByteArrayByName(_arg1) as ByteArray);
			return (_local2);
		}
		public function getClassByName(_arg1:String):Class{
			var _local2:Class = ((AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_LIB) as LibAnalyze).getClassByName(_arg1) as Class);
			return (_local2);
		}
		public function getDisplayObjectByName(_arg1:String):Object{
			var _local2:Object = ((AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_LIB) as LibAnalyze).getDisplayObjectByName(_arg1) as Object);
			return (_local2);
		}
		public function getLoaderByName(_arg1:String):Loader{
			return ((AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_MAIN) as MainAnalyze).getLoaderByName(_arg1));
		}
		public function getMaterialListByMid(_arg1:String):Array{
			return ((AnalyzeDictionary.getInstance().getAnalyze(DllFileObject.TYPE_LIS) as LisAnalyze).getMaterialByMid(_arg1));
		}
		public function getStreamFileByUrl(_arg1:String, _arg2:Function, _arg3:int=0):DisplayObject{
			var _local4:Object;
			var _local5:Loader;
			var _local6:Object;
			if (!this._loaderDic){
				this._loaderDic = new Dictionary();
				this._requestStreamList = [];
			};
			if (_arg1){
				_local4 = new Object();
				_local4.url = _arg1;
				_local4.weight = _arg3;
				this._requestStreamList.push(_local4);
				this._requestStreamList.sortOn("weight", Array.NUMERIC);
				_local5 = new Loader();
				_local6 = new Object();
				_local6.displayChild = new Sprite();
				_local6.completeFunc = _arg2;
				this._loaderDic[_arg1] = _local6;
			};
			if (!this._urlStream){
				this._loadingUrl = _arg1;
				this._urlStream = new URLStream();
				this._urlStream.addEventListener(ProgressEvent.PROGRESS, this.streamLoaderOnProgress);
				this._urlStream.addEventListener(Event.COMPLETE, this.streamLoaderComplete);
				this.startStreamLoader();
			};
			return (this._loaderDic[_arg1]["displayChild"]);
		}
		
		private function streamLoaderOnProgress(_arg1:ProgressEvent):void{
			this._urlStream.readBytes(this._streamByte, this._streamByte.length);
			if (this._tempDisplayObjectContainer.numChildren){
				this._tempDisplayObjectContainer.removeChildAt(0);
			}
			var _local2:Loader = new Loader();
			this._tempDisplayObjectContainer.addChild(_local2);
			_local2.loadBytes(this._streamByte);
		}
		
		private function startStreamLoader():void{
			this._loadingUrl = this._requestStreamList[0]["url"];
			this._tempDisplayObjectContainer = this._loaderDic[this._loadingUrl]["displayChild"];
			this._streamByte = new ByteArray();
			this._urlStream.load(new URLRequest(this._loadingUrl));
		}
		
		private function streamLoaderComplete(_arg1:Event):void{
			this._streamByte = null;
			var _local2:Object = this._loaderDic[this._loadingUrl];
			var _local3:Function = _local2["completeFunc"];
			var _local4:DisplayObject = _local2["displayChild"];
			if (!(_local3 == null) && _local4){
				_local3(_local4);
			}
			delete this._loaderDic[this._loadingUrl];
			this._requestStreamList.shift();
			if (this._requestStreamList.length != 0){
				this.startStreamLoader();
			}
		}
	}
}